package com.example.yuwei.registerlogin_system.module.RegisterModule;

import android.os.Handler;

import com.example.yuwei.registerlogin_system.bean.User;
import com.example.yuwei.registerlogin_system.tools.OperateData;

import java.net.MalformedURLException;
import java.net.URL;

public class RegisterModuleImpl implements RegisterModule {
    private String registerUrl = "http://192.168.94.110:8080/register/json/data";

    @Override
    public void register(User user, Handler mh) {

        OperateData operateData = new OperateData();
        String jsonString = operateData.userTojson(user);
        URL url = null;
        try {
            url = new URL(registerUrl);
        } catch (MalformedURLException e) {
            e.printStackTrace();

        }
        operateData.sendData(jsonString, mh, url);
    }
}
